Skip to content

fix(p2p): give each underlay address fresh 15s connection timeout#5328

Merged
gacevicljubisa merged 3 commits intomasterfrom
fix/connection-timeout-per-address
Feb 13, 2026
Merged

fix(p2p): give each underlay address fresh 15s connection timeout#5328
gacevicljubisa merged 3 commits intomasterfrom
fix/connection-timeout-per-address

Conversation

@gacevicljubisa
Copy link
Member

@gacevicljubisa gacevicljubisa commented Jan 23, 2026

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

  • Give each underlay address a dedicated 15-second connection timeout
  • Prevents later addresses from being starved of connection time
  • Increase kademlia's total peer connection timeout from 15s to 45s to accommodate multiple address attempts
  • Each bootnode connection attempt now gets the full 45s budget

Previously, when connecting to a peer with multiple underlay addresses, all addresses shared a single timeout context. This meant later addresses had little to no time remaining for connection attempts. Now each address receives its own fresh 15-second timeout, ensuring fair connection attempts to all underlay addresses.

In kademlia's bootnode connection logic, the global 15-second timeout has been removed and replaced with a per-connection 45-second timeout, allowing multiple addresses per peer to be tried sequentially with adequate time budget.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

Copy link
Member

@janos janos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok.

@acud acud added this to the v2.8.0 milestone Feb 4, 2026
@gacevicljubisa gacevicljubisa changed the title fix(p2p): give each underlay address fresh 15s connection timeout fix(p2p): give each underlay address fresh 10s connection timeout Feb 6, 2026
@gacevicljubisa gacevicljubisa changed the title fix(p2p): give each underlay address fresh 10s connection timeout fix(p2p): give each underlay address fresh 15s connection timeout Feb 10, 2026
@gacevicljubisa gacevicljubisa merged commit 91b01ad into master Feb 13, 2026
25 of 26 checks passed
@gacevicljubisa gacevicljubisa deleted the fix/connection-timeout-per-address branch February 13, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants